<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    var divingBoard = function(shorter, longer, k) {
    if (k === 0) return []
    // 如果长短都一样，那就只有一种结果．k块长的，或k块短的．
    if (shorter === longer) {
        return [k * longer]
    }
    var res = []
    for (var i = 0; i <= k; i++) {
        // 如果有i块长的，短的必然是k - i块．
        res.push(i * longer + (k - i) * shorter)
    }
    return res
};

  </script>
</body>
</html>